import {createContext,useState,useContext} from 'react';

const AuthContext = createContext();

export const useAuth = ()=>{
    return useContext(AuthContext)
}

export const AuthProvider = (props)=>{
    const [isLogin,setIsLogin]  = useState(localStorage.getItem('isLogin')||'');

    return (
        <AuthContext.Provider value={ {isLogin,setIsLogin} }>
            {props.children}
        </AuthContext.Provider>
    )
}